﻿#region Namespace imports

using System;
using System.Diagnostics;

#endregion

namespace AdventureGame
{
    internal class AdventureGame
    {
        public static void Main(String[] args)
        {
            try
            {
                Begin();
                Console.WriteLine();
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
            }
            catch(Exception e)
            {
                Trace.WriteLine(e);
            }
        }

        private static void Begin()
        {
            Console.WriteLine("Welcome to Adventure game!");
            Console.WriteLine("Copyright Stefan Faridani January 2009");
            Console.WriteLine();
            Console.WriteLine("Do you want to play Arcade Mode or Campain Mode? (press a for arcade, c for campain)");
            String command = Console.ReadLine().Trim();
            command = command.ToLower();

            if (command == "c" || command == "campain" || command == "campain mode")
            {
                Console.WriteLine("Do you want to learn to play? (Y/N)");
                command = Console.ReadLine().Trim();
                command = command.ToLower();

                if (command == "y")
                {
                    LearnToPlay.LearnToPlayCampain();
                }

                World world = new World();
                World.CampainModeBegin();
            }
            else if (command == "a" || command == "arcade" || command == "arcade mode")
            {
                Console.WriteLine("Do you want to learn to play? (Y/N)");
                command = Console.ReadLine().Trim();
                command = command.ToLower();

                if (command == "y")
                {
                    LearnToPlay.LearnToPlayBegin();
                }

                ArcadeMode.ArcadeModeBegin();
            }
            else
            {
                Console.WriteLine("Your command is incomprehensible");
                Begin();
            }
        }
    }
}